package org.nepu.scr.indexrate.converter.compliancerate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.operationreliability.SafeA116;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class SafeA116Converter implements AttributeConverter<SafeA116, String> {
    @Override
    public String convertToDatabaseColumn(SafeA116 safeA116) {
        return JSONUtil.toJsonStr(safeA116);
    }

    @Override
    public SafeA116 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, SafeA116.class);
    }
}
